package com.tedu.bill.demo4;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * Author：毕龙
 * Date: 2024/5/28 9:24
 */
public class TestFile {
    public static void main(String[] args) throws IOException {
        //创建字节流
        FileOutputStream fos = new FileOutputStream("day14/src/test.txt");
        //将字节流转化为字符流
        OutputStreamWriter osw = new OutputStreamWriter(fos);

        osw.write("窗前明月光\n");
        osw.write("疑是地上霜\n");
        osw.write("举头望明月\n");
        osw.write("低头思故乡\n");

        osw.close();
        fos.close();
    }
}
